﻿using AutoMapper;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;
using tianzedianzi.Models;
using Wk.System.Domain.Services;

namespace tianzedianzi.Controllers
{
    public class HomeController : BaseController
    {
        private readonly ILogger<HomeController> _logger;
        private readonly MenuService _menuService;
        private readonly IMapper _mapper;
        //private readonly IRestService _rest;
        public HomeController(ILogger<HomeController> logger, IMapper mapper, MenuService menuService)
        {
            _logger = logger;
            _menuService = menuService;
            _mapper = mapper;
        }
       

        public async Task<IActionResult> Index()
        {
            var tree = await _menuService.GetMenuTreeAsync(0);
            ViewData["tree"] = tree;
            return View();
        }

        //public IActionResult Privacy()
        //{
        //    return View();
        //}

        //[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
        //public IActionResult Error()
        //{
        //    return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
        //}
    }
}
